//
//  AvatarTableViewCell.m
//  JunZeWristband
//
//  Created by Kendama on 2017/8/22.
//  Copyright © 2017年 DT. All rights reserved.
//

#import "AvatarTableViewCell.h"

NSString *const kAvatarTableViewCellIdentifier = @"kAvatarTableViewCellIdentifier";

@implementation AvatarTableViewCell

+ (instancetype)dequeueReusableWithTableView:(UITableView *)tableView
{
    AvatarTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kAvatarTableViewCellIdentifier];
    if (cell == nil)
    {
        cell = [[AvatarTableViewCell alloc]init];
    }
    return cell;
}

- (instancetype)init
{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kAvatarTableViewCellIdentifier];
    if (self)
    {
//        self.selectionStyle = UITableViewCellSelectionStyleNone;
//        self.backgroundColor = [UIColor clearColor];
        [self masLayoutSubview];
    }
    return self;
}

- (void)masLayoutSubview
{
    __weak UIView *superView = self.contentView;
    [self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(superView.mas_left).with.offset(px1080Width(60));
        make.width.height.mas_equalTo(px1920Height(201));
    }];
}

- (UIImageView *)avatarView
{
    if(!_avatarView)
    {
        UIView *superView = self.contentView;
        _avatarView = [[UIImageView alloc]init];
        [superView addSubview:_avatarView];
        _avatarView.layer.cornerRadius = px1920Height(100);
        _avatarView.layer.masksToBounds = YES;

    }
    return _avatarView;
}


@end
